<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
<meta name="format-detection"
	content="telephone=no,email=no,date=no,address=no">
<title></title>
<link rel="stylesheet" type="text/css" href="../css/aui.css" />
<link rel="stylesheet" type="text/css"
	href="../css/aui-pull-refresh.css" />
<style type="text/css">
.aui-list .aui-list-item i.aui-iconfont {
	-webkit-align-self: center;
	align-self: center;
	font-size: 18px;
}
.aui-tab-item {
    line-height: 1rem;
    }
</style>
</head>
<body>
	<header class="aui-bar aui-bar-nav aui-bar-warning" id="aui-header">
	<a class="aui-pull-left" onclick="window.history.back(-1);"> <span
		class="aui-iconfont aui-icon-left"></span>
	</a>
	<div class="aui-title">员工详情</div>
	<a class="aui-pull-right"> </a> </header>

	<div class="aui-content aui-margin-b-15">
		<div class="aui-tab" id="tab" style="padding-top: 10px;" >
				<div class="aui-tab-item"   onclick="visitOpen()">
				<center>
					<img src="${pageContext.request.contextPath}/img/1.png" width="20" />
					</center>
					<p class="aui-font-size-12" style="color: #1FA5E2" >拜访</p>
				</div>
				<div class="aui-tab-item" onclick="recordOpen()" >
				<center>
					<img src="${pageContext.request.contextPath}/img/2.png" width="23" height="19" />
				</center>
					<p class="aui-font-size-12" style="color: #1FA5E2" >跟进</p>
				</div>
				<div class="aui-tab-item" onclick="contractOpen()" >
				<center>
					<img src="${pageContext.request.contextPath}/img/3.png" width="20" />
					</center>
					<p class="aui-font-size-12" style="color: #1FA5E2" >合同</p>
				</div>
				<div class="aui-tab-item" onclick="receivableOpen()" >
				<center>
					<img src="${pageContext.request.contextPath}/img/4.png" width="20" />
					</center>
					<p class="aui-font-size-12" style="color: #1FA5E2" >回款</p>
				</div>
				<div class="aui-tab-item" onclick="revisitOpen()" >
				<center>
					<img src="${pageContext.request.contextPath}/img/5.png" width="20" />
					</center>
					<p class="aui-font-size-12" style="color: #1FA5E2" >回访 </p>
				</div>
			</div>
			<ul class="aui-list aui-form-list">
				<!-- <li class="aui-list-item">
					<div class="aui-list-item-inner">
						<div class="aui-list-item-label">
							照&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;片:
						</div>
						<div class="aui-list-item-input"  >
							<img src="" width="120" height="90" id="picture" />
						</div>
					</div>
				</li> -->
				<li class="aui-list-item">
					<div class="aui-list-item-inner">
						<div class="aui-list-item-label">
							姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:
						</div>
						<div class="aui-list-item-input" id="name"></div>
					</div>
				</li>
				<li class="aui-list-item">
					<div class="aui-list-item-inner">
						<div class="aui-list-item-label">
							性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别:
						</div>
						<div class="aui-list-item-input" id="sex" ></div>
					</div>
				</li>
				<li class="aui-list-item">
					<div class="aui-list-item-inner">
						<div class="aui-list-item-label">
							所在部门:
						</div>
						<div class="aui-list-item-input" id="dept" ></div>
					</div>
				</li>
				<li class="aui-list-item">
					<div class="aui-list-item-inner">
						<div class="aui-list-item-label">
							职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;务:
						</div>
						<div class="aui-list-item-input" id="position" ></div>
					</div>
				</li>
				<li class="aui-list-item">
					<div class="aui-list-item-inner">
						<div class="aui-list-item-label">
							手机号码:
						</div>
						<div class="aui-list-item-input" id="phoneNumber" ></div>
					</div>
				</li>
				<li class="aui-list-item">
					<div class="aui-list-item-inner">
						<div class="aui-list-item-label">
							邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱:
						</div>
						<div class="aui-list-item-input" id="email" ></div>
					</div>
				</li>
				<li class="aui-list-item">
					<div class="aui-list-item-inner">
						<div class="aui-list-item-label">
							住&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址:
						</div>
						<div class="aui-list-item-input" id="address" ></div>
					</div>
				</li>
				<!--<li class="aui-list-item">
				<div class="aui-list-item-inner">
				<div class="aui-list-item-label">
				在职情况:
				</div>
				<div class="aui-list-item-input" id="workConditions" ></div>
				</div>
				</li>-->
			</ul>
		
</body>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript">
	//初始方法
	$(function() {
		getPage(pageNumber, pageSize);
	});

	//得到选择机会信息的id
	var id = "${param.id}";
		
	//当前初始页
	var pageNumber = 1;
	//每页显示多少条
	var pageSize = 10;
	var countSize = 0;
	function getPage(pageNumber, pageSize) {
		$.ajax({
					url : '${pageContext.request.contextPath}/appcrm/cardByIdDetail.do?page='
							+ pageNumber + '&limit=' + pageSize+ '&id=' +id,
					type : "POST",
					dataType : "json",
					success : function(data) {
						var html = "";
						if (data.code == "1") {
							if (typeof (data.emp) != "undefined") {
								$("#name").html(data.emp.name);
								$("#sex").html(data.emp.sex);
								$("#dept").html(data.emp.dept.deptName);
								$("#position").html(data.emp.position);
								$("#phoneNumber").html(data.emp.phoneNumber);
								$("#email").html(data.emp.email);
								$("#address").html(data.emp.address);
								$("#picture").attr("src", '${pageContext.request.contextPath}/' + data.emp.picture);
							} else {
								html = "<p style=\"font-size: 1rem;text-align: center;margin-top: 40%;\">暂无数据</p>";
									$("#nice-articles").removeClass("aui-list");
							}
							
							//alert(html);
							$("#nice-articles").html(html);
						}
					}
				});
	}

	//打开详细
	function openDetailed(id) {
		window.location.href = "${pageContext.request.contextPath}/wap/public_client.do?path=client_contract_record&id="
				+ id;
	}
	
				
	//拜访
	function visitOpen() {
		window.location.href="${pageContext.request.contextPath}/wap/public_client.do?path=client_visit_detailed&id="+id;
	}	
	//跟进
	function recordOpen(id) {
		window.location.href="${pageContext.request.contextPath}/wap/public_client.do?path=client_follow_detailed&id="+id;
	}	
	//合同
	function contractOpen(id) {
		window.location.href="${pageContext.request.contextPath}/wap/public_client.do?path=client_contract_detailed&id="+id;
	}	
	//回款
	function receivableOpen(id) {
		window.location.href="${pageContext.request.contextPath}/wap/public_client.do?path=client_receivable_detailed&id="+id;
	}
	//回访
	function revisitOpen(id) {
		window.location.href="${pageContext.request.contextPath}/wap/public_client.do?path=client_revisit_detailed&id="+id;
	}

	function toDate(data) {
		var date = new Date(data);
		var y = date.getFullYear();
		var m = date.getMonth() + 1;
		m = m < 10 ? '0' + m : m;
		var d = date.getDate();
		d = d < 10 ? ('0' + d) : d;
		return y + '-' + m + '-' + d;
	}
	/**
	 *转换金钱100,000.00 
	 */
	function formatCurrency(num) {
		if (num != null && num != "") {
			num = num.toString().replace(/\$|\,/g, '');
			if (isNaN(num))
				num = "0";
			sign = (num == (num = Math.abs(num)));
			num = Math.floor(num * 100 + 0.50000000001);
			cents = num % 100;
			num = Math.floor(num / 100).toString();
			if (cents < 10)
				cents = "0" + cents;
			for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
				num = num.substring(0, num.length - (4 * i + 3)) + ','
						+ num.substring(num.length - (4 * i + 3));
			return (((sign) ? '' : '-') + num + '.' + cents);
		}
	}
</script>
</html>